home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
04
/
8
/
DISK0481.ZIP
/
GOODIES
/
GOODIES.DOC
next >
Wrap
Text File
|
1986-02-14
|
1KB
|
46 lines
Here are some programs to make your batch files better.
XDOS calls another batch file from within a batch file, executes
the called batch file and returns to the next line after the XDOS
statement. XDOS invoked batch files may themselves contain XDOS
statements.
SAMPLE prog1 (sample command)
SAMPLE.BAT:
(other dos commands)
XDOS DOASM %1 (calls DOASM batch file and returns)
(other dos commands)
DOASM.BAT: (edit, assemble and display output)
COPY %1.asm %1.bak (backup file)
XDOS EDIT %1.asm (call procedure to edit file)
XDOS ASM %1 (call procedure to assemble file)
XDOS LINKIT %1.obj (call procedure to link file)
PUSHD pushes the current directory onto a stack and establishes a
new current directory.
POPD pops a directory off the stack and makes it the current
directory.
Posit: you want to execute an editor from any directory; but, the
editor only edits files in its own directory. In addition, you
want to have only one copy of the editor and the batch file that
calls it.
EDIT.BAT: (called in above procedure)
COPY %1 \editdir (copy file from current dir to edit dir)
PUSHD \editdir (save current dir; est \EDITDIR as new cur dir)
XEDIT %1 (edit file within \EDITDIR)
POPD (restore original dir)
COPY \editdir\%1 (copy edited file back to original dir)
DEL \editdir\%1 (remove working copy from \EDITDIR)